Ext.define('Admin.view.user.UserAddForm', {
    extend: 'Ext.form.Panel',
    alias: 'widget.userAddForm',
    requires: [],

    viewModel: {type: 'userViewModel'},
    controller: 'userViewController',
    //cls: '',

    layout: {
        type:'vbox',
        align:'stretch'
    },

    bodyPadding: 10,
    scrollable: true,

    defaults: {
        labelWidth: 60,
        labelSeparator: ''
    },

    items: [{
        xtype: 'textfield',
        fieldLabel: '用户名',
        name:'userName'
    }, {
        xtype: 'textfield',
        fieldLabel: '密码',
        name:'password'
    }],

    bbar: {
        overflowHandler: 'menu',
        items: ['->',{
            xtype: 'button',
            ui: 'soft-green',
            text: '提交',
            handler : 'submitEditForm'
        },{
            xtype: 'button',
            ui: 'soft-red',
            text: '取消',
	        handler :function(bt){
	        	var win = bt.up('window');
		        if (win) {
		            win.close();
		        }
	        }
        },'->']
    }
});